package learn.design.patterns.G_Adapter.ObjectAdapter;

import learn.design.patterns.G_Adapter.NewDeviceInterface;
import learn.design.patterns.G_Adapter.OldDevice;

// 对象适配器
public class ObjectAdapter implements NewDeviceInterface {
    private OldDevice oldDevice;

    public ObjectAdapter(OldDevice oldDevice) {
        this.oldDevice = oldDevice;
    }

    @Override
    public void newMethod() {
        oldDevice.oldMethod();
        System.out.println("Converted to newMethod.");
    }
}
